0. Run PowerShell ISE as Administrator then Execute within it the !Create_Secure_Pass_File.ps1
1. You have to run !Create_Secure_Pass_File.ps1 to create encrypted password for SQL Database and Email

2. Sometime the old backup files were unable to be deleted from the powershell
-> Check the permission of the backup folder and grand it with Modify permision

You may need to run SQL Modle install comandlet t install SQL Libraries
Install-Module -Name SqlServer

In task Schedulker use this settings:
ProgramScript:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add Arguments:
-file "D:\SQL Server Backup\!Execute_SQL_Backup_Databases.ps1"

Start In:
D:\SQL Server Backup







How To Enable PowerShell Scripting
1)  Start PowerShell ISE with Run as Administrator
2) Run this as a command "Set-ExecutionPolicy Unrestricted"
3) Accept the Warning
4) Run the PowerShell Script File PS1.